package zjut.raymond.collectorplus.pojo;

import androidx.annotation.Nullable;

public class Area {
    String id;
    String name;

    public Area() {
    }
    public Area(Area a) {
        this.id = a.id;
        this.name = a.name;
    }

    public Area(String id, String name) {
        this.id = id;
        this.name = name;
    }

    public String getId() {
        return id;
    }

    public void setId(String id) {
        this.id = id;
    }

    public String getName() {
        return name;
    }

    public void setName(String name) {
        this.name = name;
    }

    @Override
    public int hashCode() {
        int result = 17;
        result = result * 31 + ((id == null) ? 0 : id.hashCode());
        result = result * 31 + ((name == null) ? 0 : name.hashCode());
        return result;
    }

    @Override
    public boolean equals(@Nullable Object obj) {
        if(this == obj) return true;
        if(obj == null) return false;
        if(obj instanceof Area) {
            Area area = (Area) obj;
            return id.equals(area.getId()) && name.equals(area.getName());
        }
        return false;
    }
}
